/** 
  编辑变更
*/
<template>
  <div class="apply-change-score-container">
    <div style="height: 40px;">
      <el-breadcrumb separator="/" class="float-left" style="padding-top: 8px;">
        <el-breadcrumb-item :to="{ path: '/scoreChangeApply' }">
          <span @click="backToMain()">{{ $t('scoreChangeApply.scoreChangeApply') }}</span>
        </el-breadcrumb-item>
        <el-breadcrumb-item>{{ $t('common.btn.edit') }}</el-breadcrumb-item>
      </el-breadcrumb>
      <div class="float-right">
        <el-button type="text" @click="backToMain()">{{ $t('common.btn.back') }}</el-button>
      </div>
    </div>
    <el-card shadow="never" v-loading="loading" body-style="padding: 24px;">
      <div class="title">{{ $t('scoreEntryMana.basicInfo') }}</div>
      <el-form :model="basicInfo" label-position="right" label-width="90px">
        <el-row>
          <!-- 姓名 -->
          <el-col :span="6">
            <el-form-item :label="$t('scoreMangementBase.studentName') + '：'" style="margin-bottom: 0">
              {{ studentInfo.name }}
            </el-form-item>
          </el-col>
          <!-- 学号 -->
          <el-col :span="6">
            <el-form-item :label="$t('scoreMangementBase.studentId') + '：'" style="margin-bottom: 0">
              {{ studentInfo.studentId }}
            </el-form-item>
          </el-col>
          <!-- 学院 -->
          <el-col :span="6">
            <el-form-item :label="$t('scoreMangementBase.college') + '：'" style="margin-bottom: 0">
              {{ studentInfo.schoolI18n }}
            </el-form-item>
          </el-col>
          <!-- 专业 -->
          <el-col :span="6">
            <el-form-item :label="$t('scoreMangementBase.profession') + '：'" style="margin-bottom: 0">
              {{ studentInfo.majorI18n }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <!-- 辅修学院 -->
          <el-col :span="6">
            <el-form-item :label="$t('scoreChangeApply.minorFaculty') + '：'" label-width="105px" style="margin-bottom: 0">
              {{ studentInfo.minorSchoolI18n }}
            </el-form-item>
          </el-col>
          <!-- 辅修专业 -->
          <el-col :span="6">
            <el-form-item :label="$t('scoreChangeApply.minorMajor') + '：'" style="margin-bottom: 0">
              {{ studentInfo.minorMajorI18n }}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-card>
    <el-card shadow="never" v-loading="loading" body-style="padding: 24px;">
      <div class="title">{{ $t('scoreChangeApply.changeDetail') }}</div>
      <el-form :model="changeDialog" ref="changeDialog" label-position="right" label-width="90px">
        <table class="table-style-baseinfos">
          <tbody>
            <tr>
              <td class="text-right-background-color">{{ $t('scoreEntryMana.courseCode') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.courseCode }}</td>
              <td class="text-right-background-color">{{ $t('scoreEntryMana.courseName') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.courseName }}</td>
            </tr>
            <tr>
              <!-- <td class="text-right-background-color">{{ $t('scoreEntryMana.courseType') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.courseLabel }}</td> -->
              <td class="text-right-background-color">{{ $t('scoreChangeApply.examNature') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.scoreEaxmTypeI18n }}</td>
              <td class="text-right-background-color">{{ $t('scoreMangementBase.semester') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.calendarYearTermCn }}</td>
            </tr>
            <tr>
              <td class="text-right-background-color">{{ $t('scoreEntryMana.credit') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.credit }}</td>
              <td class="text-right-background-color">{{ $t('scoreChangeApply.classHours') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.periods }}</td>
            </tr>
            <!-- <tr>
              <td class="text-right-background-color">{{ $t('scoreChangeApply.examNature') }}：</td>
              <td class="text-left-background-none">{{ courseInfo.scoreEaxmTypeI18n }}</td>
              <td class="text-right-background-color"></td>
              <td class="text-left-background-none"></td>
            </tr> -->
            <!-- <tr v-for="(item, index) in courseInfo.minorScoreDetailList" :key="item.id">
              <td class="text-right-background-color">{{ $t('scoreMangementBase.original') }}{{ item.scoreTypeI18n }}：</td>
              <td class="text-left-background-none">{{ item.oldScore }}</td>
              <td class="text-right-background-color">{{ $t('scoreMangementBase.new') }}{{ item.scoreTypeI18n }}：</td>
              <td class="text-left-background-none">
                <el-form-item class="score-container" label="" :prop="'children.' + index + '.score'"> -->
                  <!-- 百分制 -->
                  <!-- <el-input v-show="item.scoreRecordType === '1001'" 
                    style="width: 100%"
                    v-model.trim="item.score" 
                    :maxlength="5"
                    clearable
                    :placeholder="$t('common.pla.pleaseInput')">
                  </el-input> -->
                  <!-- 非百分制 -->
                  <!-- <el-select style="width: 100%" v-show="item.scoreRecordType !== '1001'" v-model="item.score" clearable :placeholder="$t('common.pla.pleaseSelect')"> -->
                    <!-- 五级制 -->
                    <!-- <div v-show="item.scoreRecordType === '1002'">
                      <el-option
                        v-for="value in options.fiveLevelList"
                        :key="value.gradeSetDetailsId"
                        :label="value.scoreName"
                        :value="value.gradeSetDetailsId">
                      </el-option>
                    </div> -->
                    <!-- 两级制 -->
                    <!-- <div v-show="item.scoreRecordType === '1003'">
                      <el-option
                        v-for="value in options.twoLevelList"
                        :key="value.gradeSetDetailsId"
                        :label="value.scoreName"
                        :value="value.gradeSetDetailsId">
                      </el-option>
                    </div>
                  </el-select>
                </el-form-item>
              </td>
            </tr> -->
          </tbody>
        </table>
        <h1 class="condition-title">{{ $t('scoreEntryMana.scoreList') }}</h1>
        <el-table border stripe :data="courseInfo.minorScoreDetailList" size="mini" style="margin-bottom: 20px">
          <!-- 成绩种类 -->
          <el-table-column :label="$t('studentPerformMaintain.gradeType')" prop="scoreTypeI18n" align="center"></el-table-column>
          <!-- 考试性质 -->
          <el-table-column :label="$t('scoreChangeApply.examNature')" prop="scoreEaxmType" align="center">
            <template slot-scope="scope">
              <el-form-item class="score-container" label="">
                  <!-- 百分制 -->
                  <!-- <el-input v-show="scope.row.scoreRecordType === '1001'" 
                    style="width: 100%"
                    v-model.trim="scope.row.score" 
                    :maxlength="5"
                    clearable
                    :placeholder="$t('common.pla.pleaseInput')">
                  </el-input> -->
                  <!-- 非百分制 -->
                  <el-select style="width: 100%" v-model="scope.row.scoreEaxmType" @change="scoreExamTypeChange(scope.row,scope.$index)" :placeholder="$t('common.pla.pleaseSelect')">
                    <!-- 非期末成绩和非重缓考的考试性质 -->
                    <div v-show="scope.row.scoreType === '11005' || scope.row.scoreType === '11006' || scope.row.scoreType === '11007'">
                      <el-option
                        v-for="item in options.notFinalGradeList"
                        :key="item.key"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </div>
                    <!-- 期末成绩的考试性质 -->
                    <div v-show="scope.row.scoreType === '11008'">
                      <el-option
                        v-for="item in options.examNature"
                        :key="item.key"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </div>
                    <!-- 重缓考的考试性质 -->
                    <div v-show="scope.row.scoreType === '11003' || scope.row.scoreType === '11004'">
                      <el-option
                        v-for="item in options.retakeExamList"
                        :key="item.key"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </div>
                  </el-select>
                </el-form-item>
            </template>
          </el-table-column>
          <!-- 原成绩 -->
          <el-table-column :label="$t('scoreEntryMana.oldScore')" prop="oldScore" align="center"></el-table-column>
          <!-- 成绩 -->
          <el-table-column :label="$t('scoreMangementBase.grade')" prop="score" align="center">
            <template slot-scope="scope">
              <el-form-item class="score-container" label="">
                  <!-- 百分制 -->
                  <el-input v-show="scope.row.scoreRecordType === '1001'" 
                    style="width: 100%"
                    :disabled="scope.row.scoreEaxmType !== '14001'"
                    v-model.trim="scope.row.score" 
                    :maxlength="5"
                    clearable
                    :placeholder="$t('common.pla.pleaseInput')">
                  </el-input>
                  <!-- 非百分制 -->
                  <el-select style="width: 100%" v-if="scope.row.scoreRecordType !== '1001'" v-model="scope.row.score" :disabled="scope.row.scoreEaxmType !== '14001'" clearable :placeholder="$t('common.pla.pleaseSelect')">
                    <!-- 五级制 -->
                    <div v-show="scope.row.scoreRecordType === '1002'">
                      <el-option
                        v-for="value in options.fiveLevelList"
                        :key="value.gradeSetDetailsId"
                        :label="value.scoreName"
                        :value="value.gradeSetDetailsId">
                      </el-option>
                    </div>
                    <!-- 两级制 -->
                    <div v-show="scope.row.scoreRecordType === '1003'">
                      <el-option
                        v-for="value in options.twoLevelList"
                        :key="value.gradeSetDetailsId"
                        :label="value.scoreName"
                        :value="value.gradeSetDetailsId">
                      </el-option>
                    </div>
                  </el-select>
                </el-form-item>
            </template>
          </el-table-column>
        </el-table>
        <el-row>
          <el-col :span="24">
            <el-form-item :label="$t('scoreChangeApply.applyExplanation') + '：'" prop="applyExplanation" :rules="[{ required: true, message: $t('scoreChangeApply.requireApplyExplanation'), trigger: 'blur'}]">
              <el-input type="textarea" :rows="5" :placeholder="$t('common.pla.pleaseInput')" v-model="changeDialog.applyExplanation" :maxlength="32" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item
              :label="$t('scoreChangeApply.evidence') + '：'" 
              prop="evidence"
              :rules="[{ required: true, message: $t('scoreChangeApply.requireEvidence'), trigger: 'change'}]">
                <el-upload
                  v-model="changeDialog.evidence"
                  class="upload-info"
                  action="/api/commonservice/obsfile/uploadfile"
                  :data="uploadConfig.data"
                  :on-exceed="handleExceed"
                  :before-upload="(file) => beforeUpload(file)"
                  :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList)"
                  :before-remove="(file, fileList) => handlerBeforeRemove(file, fileList)"
                  :on-remove="(file, fileList) => handlerRemove(file, fileList, 111)"
                  :on-error="(err, file, fileList) => handlerUploadError(err, file, fileList)"
                  :on-preview="(file) => downloadMaterial(file, 111)"
                  accept=".bmp, .rar, gif, image/png, image/jpeg, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                  :limit="1"
                  :file-list="fileList">
                  <el-button size="small" type="primary">{{ $t('graduateBase.chooseFile') }}</el-button>
                </el-upload>
                <div class="file-tip-info">{{ $t('scoreChangeApply.evidenceTip') }}</div>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div class="footer-container">
        <el-button @click="cancel()">{{ $t('common.btn.cancel') }}</el-button>
        <el-button type="primary" @click="submit()">{{ $t('common.btn.submit') }}</el-button>
      </div>
    </el-card>
    <el-card shadow="never" v-loading="loading" body-style="padding: 24px;">
      <div class="title">{{ $t('scoreMangementBase.auditProgress') }}</div>
      <edu-table :pagination="false" :tooltipEffect="tooltipEffect" :selection="false" stripe :data="approvalProgressData" size="mini">
        <edu-table-column :label="$t('scoreMangementBase.time')" prop="time">
          <template slot-scope="scope">
            {{ scope.row.time | time }}
          </template>
        </edu-table-column>
        <edu-table-column :label="$t('scoreMangementBase.character')" prop="role"></edu-table-column>
        <edu-table-column :label="$t('scoreMangementBase.approvalDepartment')" prop="approvorName"></edu-table-column>
        <edu-table-column :label="$t('scoreMangementBase.approvalResults')" prop="result">
          <template slot-scope="scope">
            {{ scope.row.result | result}}
          </template>
        </edu-table-column>
        <edu-table-column :label="$t('scoreMangementBase.approvalInstructions')" prop="content"></edu-table-column>
      </edu-table>
    </el-card>
    <!-- 确认弹框开始 -->
    <el-dialog
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :title="$t('scoreChangeApply.gradeChangeTitle')"
      width="400px">
      <span>{{ minorScoreChangeTip }}</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">{{ $t('common.btn.cancel') }}</el-button>
        <el-button type="primary" @click="confirmChange">{{ $t('common.btn.confirm') }}</el-button>
      </span>
    </el-dialog>
    <!-- 确认弹框结束 -->
  </div>
</template>
<script>
import scoreManagementApi from 'common/src/api/scoreManagement/scoreManagement';
import * as INDEX from 'common/src/utils/index';
import UTILS from "common/src/utils/utils";
import { downloadfile } from "common/src/api/upload";
import { queryDic } from "common/src/api/dictionary";
export default {
  components: {
  },
  data () {
    return {
      dialogVisible: false,
      fileList: [],
      approvalProgressData: [],
      uploadConfig: {
        data: { bucketname: 'face', folderpath: 'file' },
      },
      changeDialog: {
        applyExplanation: '',
        evidence: ''
      },
      studentInfo: {
        "name": "",
        "studentId": "",
        "phoneNumber": "",
        "school": "",
        "major": "",
        "minorSchool": "",
        "minorMajor": "",
        "schoolI18n": "",
        "majorI18n": "",
        "minorSchoolI18n": "",
        "minorMajorI18n": ""
      },
      courseInfo: {},
      options: {
        twoLevelList: [],
        fiveLevelList: [],
        hundredLevelList: [],
        allLevelList: [],
        examNature: [],
        notFinalGradeList: [], // 正常+违纪
        retakeExamList: [] // 重缓考：正常+无资格+违纪+旷考
      },
      examNatureObj: {}, // 考试性质字典
      fileInfo: {
        upFileName: '',
        upFileKey: ''
      },
      basicInfo: {},
      minorScoreChangeTip: '' // 点击提交按钮弹出提示
    }
    
  },
  props: {
    detailInfo: {
      type: Object,
      default: () => {}
    }
  },
  filters: {
    result(val) {
      switch(val) {
        case 'COMMIT':
          return '提交'
        case 'Process':
          return '通过'
        case 'Reject':
          return '已驳回'
        case 'Recall':
          return '撤回'
        case 'End':
          return '通过'
        case 'approveNoPass':
          return '未通过'
        default: 
          return val
      }
    },
    time(time) {
      return INDEX.parseTime(time, '{y}-{m}-{d}')
    }
  },
  created() {

  },
  async mounted() {
    await this.initOptions()
    await this.getGradeRecordMethod()
    let _this = this
    scoreManagementApi.selectScoreChangeApplyInfo(this.detailInfo).then(res => {
      if (res.code === 200) {
        this.basicInfo = res.data
        this.approvalProgressData = res.data.approveDetailList
        if (res.data.minorScoreChangeStudentBasicInfoVO) {
          this.studentInfo = res.data.minorScoreChangeStudentBasicInfoVO
        }
        this.courseInfo = res.data.minorScoreChangeDetailsVO
        this.changeDialog.applyExplanation = this.courseInfo.applyReason
        this.changeDialog.evidence = this.courseInfo.upFileKey
        this.fileInfo.upFileKey = this.courseInfo.upFileKey
        this.fileInfo.upFileName = this.courseInfo.upFileName
        this.fileList = [{
          url: this.fileInfo.upFileKey,
          name: this.fileInfo.upFileName,
          uid: this.fileInfo.upFileKey
        }]
        // 后续拉通流程再改
        this.courseInfo.scoreEaxmTypeI18n = '正常'
        if (_this.courseInfo.minorScoreDetailList.length > 0) {
          _this.courseInfo.minorScoreDetailList.map(value => {
            value.score = isNaN(value.score) ? value.score : parseInt(value.score)
          })
        }
      }
    })
  },
  methods: {
    // 返回主页
    backToMain() {
      this.$emit('refresh-main-page')
    },
    async initOptions() {
      // 筛选条件字典查询
      let data = {
        lang: this.$store.getters.language || "cn",
        type: "allChild",
        keys: [
          "X_YXCK_FX" // 辅修允许重考的考试情况
        ]
      }
      let resp = await queryDic(data)
      if (resp.code === 200) {
        this.examNatureObj = resp.data["X_YXCK_FX"]
        UTILS.fillSelect(
          {
            examNature: "X_YXCK_FX" // 辅修允许重考的考试情况
          },
          resp.data,
          this.options
        )
        // 正常+违纪
        this.options.notFinalGradeList = this.options.examNature.filter(value => {
          return value.value === '14001' || value.value === '14004'
        })
        // 重缓考：正常+无资格+违纪+旷考
        this.options.retakeExamList = this.options.examNature.filter(value => {
          return value.value !== '14002'
        })
      }
    },
    // 获取成绩记录方式
    async getGradeRecordMethod() {
      let resp = await scoreManagementApi.getScoreRecordMethodList({
        "gradeNameCn": "",
        "pageNum_": 1,
        "pageSize_": 20
      })
      if (resp.code === 200) {
        if (resp.data.list.length > 0) {
          resp.data.list.forEach(value => {
            // 两级制
            if (value.gradeNameCode === '1003') {
              this.options.twoLevelList = value.minorGradeRelatedSetDetailsList
            } else if (value.gradeNameCode === '1002') { // 五级制
              this.options.fiveLevelList = value.minorGradeRelatedSetDetailsList
            } else if (value.gradeNameCode === '1001') { // 百分制
              this.options.hundredLevelList = value.minorGradeRelatedSetDetailsList
            }
          })
          this.options.allLevelList = [].concat(this.options.twoLevelList, this.options.fiveLevelList, this.options.hundredLevelList)
        }
      }
    },
    scoreExamTypeChange(row,index){
      if(row.scoreEaxmType !== '14001' ){
        this.$set(this.courseInfo.minorScoreDetailList[index], 'score', this.getScoreTypeName(row.scoreEaxmType))
      }
      else{
        this.$set(this.courseInfo.minorScoreDetailList[index], 'score', '')
        // this.$set(this.childrenScoreList[index], 'scoreNew', this.childrenScoreList[index].oldScoreEaxmType==1?this.childrenScoreList[index].score:'')
      }
    },
    getScoreTypeName(id){
      let recordName=''
      try{
        this.options.examNature.forEach((val,itm)=>{  
        if(id === val.value)  {
          recordName=val.label  
          throw Error()
        }    
      })
      }catch(e){

      }      
      return recordName
    },
    // 取消
    cancel() {
      this.$confirm(this.$t('scoreMangementBase.cancelTip'), this.$t('scoreMangementBase.prompt'), {
        confirmButtonText: this.$t('scoreMangementBase.confirm'),
        cancelButtonText: this.$t('scoreMangementBase.cancel'),
        type: 'warning'
      }).then(() => {
        this.$emit('refresh-main-page')
      })
    },
    // 提交
    submit() {
      let minorScoreIteamList = []
      if (this.courseInfo.minorScoreDetailList.length > 0) {
        this.courseInfo.minorScoreDetailList.map(item => {
          minorScoreIteamList.push({
            "childId": item.childId,
            "scoreChildId": item.scoreChildId,
            "oldScore": item.oldScore,
            "score": item.score.toString(),
            "scoreValue": item.scoreRecordType === '1001' ? item.score.toString() :isNaN(item.score) ? item.score : UTILS.translateLabel(this.options.allLevelList, parseInt(item.score), 'gradeSetDetailsId', 'scoreName').toString(),
            "scoreType": item.scoreType,
            "scoreRecordType": item.scoreRecordType,
            "scoreEaxmType": item.scoreEaxmType
          })
        })
      }
      for (const item of minorScoreIteamList) {
        if (!item.score) {
          this.$message({
            message: this.$t('scoreEntryMana.scoreContent'),
            type: 'warning'
          })
          return
        }
      } 
      let params = {
        "id": this.courseInfo.id,
        "courseCode": this.courseInfo.courseCode,
        "courseName": this.courseInfo.courseName,
        "teachingClassId": this.courseInfo.teachingClassId,
        "calendarId": this.courseInfo.calendarId,
        "scoreEaxmType": this.courseInfo.scoreEaxmType,
        "scoreRecordType": this.courseInfo.scoreRecordType,
        "keepField": this.courseInfo.keepField,
        "minorScoreDetailList": minorScoreIteamList
      }
      scoreManagementApi.minorScoreChangeTip(params).then(res => {
        if (res.code === 200) {
          this.minorScoreChangeTip = res.data
          this.dialogVisible = true
        }
      })
    },
    // 确认提交
    confirmSubmit() {
      this.$refs['changeDialog'].validate((valid) => {
        if (valid) {
          let minorScoreIteamList = []
          if (this.courseInfo.minorScoreDetailList.length > 0) {
            this.courseInfo.minorScoreDetailList.map(item => {
              minorScoreIteamList.push({
                "childId": item.childId,
                "oldScore": item.oldScore,
                "score": item.score.toString(),
                "scoreValue": item.scoreRecordType === '1001' ? item.score.toString() : isNaN(item.score) ? item.score : UTILS.translateLabel(this.options.allLevelList, parseInt(item.score), 'gradeSetDetailsId', 'scoreName').toString(),
                "scoreType": item.scoreType,
                "scoreEaxmType": item.scoreEaxmType
              })
            })
          }
          let params = {
            "id": this.basicInfo.id,
            "editStatus": "1",
            "masterId": this.detailInfo.masterId,
            "applyReason": this.changeDialog.applyExplanation,
            "upFileName": this.fileInfo.upFileName,
            "upFileKey": this.fileInfo.upFileKey,
            "minorScoreIteamList": minorScoreIteamList
          }
          scoreManagementApi.applyOrEditScoreChangeApply(params).then(res => {
            if (res.code === 200) {
              this.$message.success(this.$t('scoreMangementBase.submitSuccessfully'))
              this.$emit('refresh-main-page')
            }
          })
        }
      })
    },
    // 文件类方法开始
    handleExceed(files, fileList) {
      this.$message.error(this.$t('externamExchangeBase.limitOneFile'))
    },
    handlerBeforeRemove(file, fileList) {
      // if (this.fileFlag) {
      //   return this.$delConfirm().then(_ => {})
      // }
    },
    handlerRemove(file, fileList) {
      this.fileInfo.upFileName = ''
      this.fileInfo.upFileKey = ''
      this.changeDialog.evidence = ''
    },
    beforeUpload(file, fileNumber, key) {
     const fileSizeFlag = file.size && file.size / 1024 / 1024 < 5
      let fileNameLength = file.name.length <= 64
      let fileName = file.name.substring(0, file.name.lastIndexOf('.'))
      let fileNameRepeat = false
      let fileType = file.name.substring(file.name.lastIndexOf('.') + 1)
      const uploadFlag = fileType === 'jpg' || fileType === 'jpeg' || fileType === 'png' || fileType === 'bmp' || fileType === 'gif' || fileType === 'doc' || fileType === 'docx' || fileType === 'xls' || fileType === 'xlsx'
      if (!uploadFlag) {
        window.vueApp.showMsgBox({
          message: this.$t("minor.approve.uploadFileError"),
          callback: () => {
          }
        })
      }
      if (!fileSizeFlag) {
        window.vueApp.showMsgBox({
          message: this.$t("scoreChangeApply.fileSizeTip"),
          callback: () => {
          }
        })
      }
      if (!fileNameLength) {
        window.vueApp.showMsgBox({
          message: this.$t("externamExchangeBase.uploadNameLength"),
          callback: () => {
          }
        })
      }
      this.fileFlag = (uploadFlag && fileSizeFlag && fileNameLength)
      if (!(uploadFlag && fileSizeFlag && fileNameLength)) {
        return false
      }
    },
    handlerUploadSuccess(response, file, fileList, fileNumber, key) {
      let responseCode = response.code
      if (responseCode === 200) {
        this.fileInfo.upFileName = Object.values(response.data)[0].fileName
        this.fileInfo.upFileKey = Object.values(response.data)[0].objectkey
        this.changeDialog.evidence = this.fileInfo.upFileKey
      }
    },
    handlerUploadError(response, file, fileList, fileNumber, key) {
      this.$message({
        message: this.$t('graduateBase.uploadFail'),
        type: 'error',
      })
      this.fileInfo.upFileName = ''
      this.fileInfo.upFileKey = ''
    },
    downloadMaterial(file, fileNumber, key) {
      if (file.url) {
        downloadfile(file.url);
      } else if (file.status === 'success' && file.response.data) {
        downloadfile(file.response.data[file.name].objectkey)
      }
    },
    // 文件类方法结束
    // 确认变更
    confirmChange() {
      this.dialogVisible = false
      this.confirmSubmit()
    }
  }
}
</script>

<style lang="scss" scoped>
  .apply-change-score-container ::v-deep {
    .title {
      margin-bottom: 20px;
      font-weight: bold;
      font-size: 18px;
    }
    .table-style-baseinfos {
      border-collapse: collapse;
      table-layout: fixed;
      word-break: break-all;
      background-color: rgba(210, 212, 214, 1);
      border-width: 0.5px;
      border-style: solid;
      border-color: rgba(210, 212, 214, 1);
      width: 100%;
      font-weight: 401;
      font-style: normal;
      font-size: 14px;
      color: #8896a7;
      margin-bottom: 20px;
    }
    .table-style-baseinfos .text-right-background-color {
      background-color: #edf1f5;
      text-align: right;
    }
    .text-left-background-none {
      text-align: left;
    }
    .table-style-baseinfos td {
      width: 25%;
      background-color: rgba(255, 255, 255, 1);
      border-width: 0.5px;
      border-style: solid;
      border-color: rgba(210, 212, 214, 1);
      font-weight: 401;
      font-style: normal;
      font-size: 14px;
      color: #2b3b4e;
      height: 32px;
      padding: 0 10px;
    }
    .score-container {
      margin: 10px 0!important;
      .el-form-item__content {
        margin-left: 0!important;
      }
    }
    .upload-info {
      display: inline-block;
      width: 500px;
    }
    .footer-container {
      width: 100%;
      text-align: right;
      padding: 15px;
    }
  }
</style>